package cn.edu.xust.communication.enums;

public enum ElectricTableEnums {
    T_ELEC("elec","t_elec_"),
    BATTERY_HOUR("batteryHour","battery_hour_");
    private String  type;
    private String  name;


    ElectricTableEnums(String type, String name) {
        this.type = type;
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public String getTableName(String type,String  time){
        StringBuilder stringBuilder =new StringBuilder();
        if(ElectricTableEnums.T_ELEC.type.equalsIgnoreCase(type)){
            stringBuilder.append(ElectricTableEnums.T_ELEC.name + time);
        }else {
            stringBuilder.append(ElectricTableEnums.BATTERY_HOUR.name + time);
        }
        return stringBuilder.toString();
    }


}
